SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 36667: Time values that exceed 24 hours do not properly export when you use the EXCEL engine

DetailsHotfixAboutRate It

Time values that are greater than 24 hours are not exported properly when you use the EXCEL engine to export data to Microsoft Excel. The following example illustrates code that contains a time value greater than 24 hours:

data toto; input time time8.; timeTime8=time; format timeTime8 time8. cards; 48:05:08 ; run; proc export data=toto outfile="filename.xls" dbms=excel; sheet="sheet-name"; run;

When the time value is displayed in Excel, it is displayed as 1/0/1900 12:05:08 AM. To resolve this problem, do one of the following:

  • For SAS® 9.1.3, click the Hot Fix tab in this note to access the hot fix for this issue.
  • For SAS® 9.2 TS1M0, export time vaules with the DATETIME20. format, as shown in the following example:
    data toto; input time time8.; timeTime8=time; timeDatetime20=time; format timeTime8 time8. timeDatetime20 datetime20.; cards; 48:05:08 ; run; proc export data=toto outfile="filename.xls" dbms=excel; sheet="sheet-name"; run;
  • For SAS 9.2 TS2M0, do one of the following:
    • Upgrade to SAS 9.2 TS2M2 or later.
    • Use the XLS engine (DBMS=XLS) to export your data.
    • Use the DATEETIME20. format to export the data.


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to PC FilesMicrosoft Windows Server 2003 Datacenter 64-bit Edition9.1 TS1M39.2 TS2M2
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.1 TS1M39.2 TS2M2
Microsoft Windows XP 64-bit Edition9.1 TS1M39.2 TS2M2
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M39.2 TS2M2
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M39.2 TS2M2
Microsoft Windows Server 2003 Standard Edition9.1 TS1M39.2 TS2M2
Microsoft Windows XP Professional9.1 TS1M39.2 TS2M2
Windows Vista9.1 TS1M39.2 TS2M2
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.